package org.pine.dictionary.util;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.pine.dictionary.bean.PageResponse;

import java.util.List;


/**
 * <p>
 * 分页工具类
 * </p>
 *
 * @author pine
 * @since 2024-05-16
 */
public class PageUtil {
    public PageUtil() {
    }

    /**
     * 分页结构转换
     */
    public static <T> PageResponse<T> convertPage(IPage<?> page, List<T> list) {
        return new PageResponse<>(list, (int)page.getTotal(), (int)page.getSize(), (int)page.getCurrent());
    }
}
